<?php 
class detailAction extends sfAction{
	private $data = null;
	public function execute($request){
		$id = intval($request->getParameter('id'));
		if($id <= 0){
			$this->redirect($this->generateUrl('news'));
			return sfView::NONE;
		}
		$this->data['news_cate']	= NewsCatesTable::getDataById(intval($request->getParameter('cate_id',-1)));
		$this->data['banners']		= BannersTable::getDataListFrontend(null);
		$this->data['news']			= NewsTable::getDataById($id);
		//$this->data['related']		= NewsTable::getDataListFrontend(array('ids_notin'=>ArrayHelper::getArrayIds($this->data['news'])),1,10);
		
		$this->data['id']	= $id;
		$this->setVar('data', $this->data);
	}
}